Skip to content

Fix bug with extract_data_from_json and jmespath int or float#160

Open
smk4664 wants to merge 1 commit intodevelopfrom
u/smk4664-jdiff-type-error-with-float
Open

Fix bug with extract_data_from_json and jmespath int or float#160
smk4664 wants to merge 1 commit intodevelopfrom
u/smk4664-jdiff-type-error-with-float

Conversation

@smk4664
Copy link
Copy Markdown

@smk4664 smk4664 commented May 7, 2026

Closes: #159

This PR ensures that we only try to iterate over a list when extracting data using the JMESPath. During my testing, I did notice that this was not always happening, depending on how I wrote the JMESPath, so it is possible that this may be unnecessary.

The following works:

data = [
{"metric": 1000, "threshold": .75}
]

path = "[].metric" or "[].threshold"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The extract_data_from_json does not work when the jmespath is an integer or float

1 participant